package com.bitdf.txing.common.vo;

import com.bitdf.txing.common.valid.UpdateGroup;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * @author Lizhiwei
 * @date 2023/2/6 21:56:24
 * 注释：
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserInfoVo {
    /**
     * 用户id
     */
    @NotNull(groups = {UpdateGroup.class})
    private Long id;
    /**
     * 会员等级id
     */
    @Null(groups = {UpdateGroup.class})
    private Integer levelId;
    /**
     * 用户名
     */
    @Length(min = 2, max = 20, groups = {UpdateGroup.class})
    private String userName;
    /**
     * 昵称
     */
    @Length(min = 2, max = 20, groups = {UpdateGroup.class})
    private String nickName;
    /**
     * 手机号
     */
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$",message = "手机号格式不正确",groups = {UpdateGroup.class})
    private String phone;
    /**
     * 邮箱
     */
    @Email(groups = {UpdateGroup.class})
    private String email;
    /**
     * 头像
     */
    @URL(groups = {UpdateGroup.class})
    private String header;
    /**
     * 性别
     */
    @Range(max = 1, min = 0, groups = {UpdateGroup.class})
    private Integer sex;
    /**
     * 生日
     */
    private Date birth;
    /**
     * 所在城市
     */
    private String city;
    /**
     * 职业
     */
    private String job;
    /**
     * 个性签名
     */
    private String sign;
    /**
     * 积分
     */
    private Integer integration;
    /**
     * 启用状态
     */
    @Null(groups = {UpdateGroup.class})
    private Integer status;
    /**
     * 注册时间
     */
    @Null(groups = {UpdateGroup.class})
    private Date createTime;
    /**
     * 公司或学校
     */
    private String unit;
    /**
     * 学院
     */
    private String institute;
    /**
     * 专业
     */
    private String major;
    /**
     * 角色ID
     */
    private Long roleId;
}
